// Copyright DustedPixels.com 2008. All rights reserved.

package com.dustedpixels.dcel.parser;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang.SystemUtils;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;

import com.dustedpixels.daflan.UnitVisitor;

/**
 * @author micapolos@gmail.com (Michal Pociecha-Los)
 */
public final class PrimitiveUnitWriter implements UnitVisitor {
  String packageName;
  String unitName;
  List<String> pins;
  
  public PrimitiveUnitWriter() {
  }
  
  public void visitBegin() {
    this.pins = new ArrayList<String>();
    this.
  }
  
  public void visitPackageName(String name) {
    this.packageName = name;
  }
  
  public void visitUnitName(String name) {
    this.unitName = name;
  }

  public void visitPinsBegin() {
    
  }


  public void visitPin(String name) {
    this.pins.add(name);
  }


  public void visitPinsEnd() {
    
  }

  public void visitComponentsBegin() {
    
  }

  public void visitComponent(String name, String unitName) {
    // TODO Auto-generated method stub
    
  }



  public void visitComponentsEnd() {
    // TODO Auto-generated method stub
    
  }



  public void visitEnd() {
    // TODO Auto-generated method stub
    
  }



  public void visitJumper(String componentName1, String pinName1, String componentName2,
      String pinName2) {
    // TODO Auto-generated method stub
    
  }



  public void visitJumpersBegin() {
    // TODO Auto-generated method stub
    
  }



  public void visitJumpersEnd() {
    // TODO Auto-generated method stub
    
  }




  public void visitScriptBegin() {
    // TODO Auto-generated method stub
    
  }



  public void visitScriptEnd() {
    // TODO Auto-generated method stub
    
  }



  public void visitScriptEntry(String componentName) {
    // TODO Auto-generated method stub
    
  }



  void writeAndInitializer(MethodVisitor visitor) {
    
  }

  void writeAndGate(MethodVisitor visitor, int in1, int in2, int out) {
    visitor.visitVarInsn(Opcodes.ILOAD, in1);
    visitor.visitVarInsn(Opcodes.ILOAD, in2);
    visitor.visitInsn(Opcodes.IAND);
    visitor.visitVarInsn(Opcodes.ISTORE, out);
  }
}
